how to count the occurrences of a string within a string